package com.job.meituan;

import java.util.*;

/**
 * @author angzhijin
 * @Description
 * @create 2022-08-13 4:50 下午
 */
public class Meituan0813 {
    public static void main(String[] args) {
        Meituan3();
    }

    public static void Mwituan2(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int k = sc.nextInt();
        sc.nextLine();
        char[] path = sc.nextLine().toCharArray();

        int[][] room = new int[n][m];
        int all = n * m;
        int x = 0, y = 0;
        room[x][y] = 1;
        int count = 1; // 已打扫过的

        for (int i=0;i<k;i++) {
            char ch = path[i];
            switch (ch) {
                case 'W':
                    x -= 1;
                    break;
                case 'A':
                    y -= 1;
                    break;
                case 'S':
                    x += 1;
                    break;
                case 'D':
                    y += 1;
                    break;
            }

            if (room[x][y] == 0) {
                room[x][y] = 1;
                count++;
            }
            if (count == all) {
                System.out.println("Yes");
                System.out.println(i+1);
                return;
            }
        }
        System.out.println("No");
        System.out.println(all - count);
    }


    public static void Meituan3(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] record = new int[n];
        for(int i=0;i<n;i++){
            record[i] = sc.nextInt();
        }

        Deque<Integer> card = new LinkedList<>();

        for (int i = n-1; i>=0;i--) {
            card.addFirst(record[i]);
            card.addFirst(card.removeLast());
            card.addFirst(card.removeLast());
        }

        System.out.println(Arrays.toString(card.toArray()));
    }


    public static void Meituan4(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] nums = new int[n];
        Map<Integer, List<Integer>> map = new HashMap<>();
        for(int i=0;i<n;i++){
            nums[i] = sc.nextInt();
            List<Integer> indexs = map.getOrDefault(nums[i], new ArrayList<Integer>());
            indexs.add(i);
            map.put(nums[i],indexs);
        }
        int count =0;
        for(int i=0;i<n-2;i++){
            for(int j=i+1;j<n-1;j++){
                int a = nums[i];
                int b = nums[j];
                int c = 3*b-a;
                if(!map.containsKey(c))
                    break;
                List<Integer> cs = map.get(c);
                for(int k=0; k<cs.size();k++){
                    if(cs.get(k)>j){
                        count+= cs.size()-k+1;
                        break;
                    }

                }
            }
        }
        System.out.println(count);
    }

    public static void Meituan5(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] nums = new int[n+1];
        for(int i=1;i<n;i++){
            nums[i] = sc.nextInt();
        }
        int res = dfs(nums, n, 1);
        System.out.println(res);
    }

    public static int dfs(int[] nums, int size, int index){
        if(index>size) return 0;
        int left = dfs(nums, size, 2*index);
        int right = dfs(nums, size,2*index+1);
        return Math.max(left, right) + nums[index];
    }
}
